package com.timvanx.biggerdvd.util;

import java.io.PrintWriter;

/**
 * 一些servlet共有的方法或属性
 *
 * @author TimVan
 * @date 2018年10月10日08:46:23
 */
public class CommonUtil {

    /**
     * 弹出提示框，点击确认后跳转其他页面
     **/
    static public void popAlert(PrintWriter out
            , String title,String ctx, String href) {
        StringBuilder sb =
                new StringBuilder("<html><head><meta charset=\"UTF-8\"><title>"+title+"</title></head><body><div class=\"mailwrapper\" style=\"font-size: 15px; color: #666666;\"><table style=\"table-layout:fixed;width:100%;padding: 0; border: 0;\" cellpadding=\"0\" cellspacing=\"0\"><tbody><tr><td><table align=\"center\" class=\"mainTable centerColumnWelcome\"                       style=\"margin:0 auto;font-size: inherit; line-height: inherit; border-collapse: collapse !important; border-spacing: 0; -premailer-cellpadding: 0; -premailer-cellspacing: 0; width: 800px; -premailer-width: 800; padding: 0px; border: 0px;\"                       cellpadding=\"0\" cellspacing=\"0\"><tbody><tr class=\"topPadding\" height=\"38\"><td style=\"font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; margin: 0; padding: 0px; border: 0px;\"></td></tr><tr><td class=\"centerColumnWelcome block1bg\"                            background=\"https://statici.icloud.com/emailimages/v4/familysharing/bkg_top_section.png\"                            style=\"font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; width: 800px; -premailer-width: 800; background-size: 100% 360px !important; background: url('https://statici.icloud.com/emailimages/v4/familysharing/bkg_top_section.png') no-repeat center bottom; margin: 0; padding: 0px; border: 0px; background-position: center bottom;\"><table align=\"center\"                                   style=\"margin: 0 auto; font-size: inherit; line-height: inherit; border-collapse: collapse !important; align: center; border-spacing: 0; padding: 0px; border: 0px;\"></table></td></tr><tr><td align=\"center\"                            style=\"font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; margin: 0; padding: 0px; border: 0px;\"><img class=\"icloud_family_logo\"                                 src=\"https://statici.icloud.com/emailimages/v4/accounts/welcome-2015/en_us/icloudwelcome_icloudlogo_2x.png\"                                 style=\"display: block; border: 0px;\" width=\"146\" height=\"94\"></td></tr><tr><td class=\"header2\" align=\"center\"                            style=\"font-family: 'SFNSText', 'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; color: #000000; font-size: 43px; line-height: 47px; margin: 0; padding: 23px 0px 0px; border: 0px;\">"+ctx+"</td></tr><tr class=\"blockPadding\" height=\"25\"><td style=\"font-family:'Helvetica Neue', Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; margin: 0; padding: 0px; border: 0px;\"></td></tr><tr></tr></tbody></table></td></tr></tbody></table><br><br><table class=\"footerTable centerColumn\" align=\"center\" style=\"width: 800px; margin: 0 auto;\" cellpadding=\"0\"           cellspacing=\"0\"><tbody><tr><td class=\"footer background centerColumn\" id=\"footerGroup1\"                background=\"https://statici.icloud.com/emailimages/v4/common/footer_gradient_web.png\"                style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-smooth: always; -webkit-font-smoothing: antialiased; width: 685px; font-size: 11px; color: #888; text-align: center; background-repeat: no-repeat; background-position: center top; padding: 15px 0 10px;\"                align=\"center\"><img width=\"81\" height=\"22\" src=\"https://wx3.sinaimg.cn/mw690/0060lm7Tly1fx4b22dr4mj308n01gdfp.jpg\"                     style=\"display: inline-block; width: 85px; height: 15px;\"></td></tr><tr><td class=\"footer centerColumn content\"                style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-smooth: always; -webkit-font-smoothing: antialiased;  width: 685px; font-size: 11px; line-height: 14px; color: #888; text-align: center;\"                align=\"center\"><span class=\"service\">BiggerDVD 是 TimVan 提供的服务。</span><span class=\"footer1\"                                                                                           style=\"white-space: nowrap;\"><a                    href=\"https://www.bihaiheifan.com/java/ftm/index.html\" style=\"color: #08c; text-decoration: none;\"                    rel=\"noopener\" target=\"_blank\">首页</a></span> |<span class=\"footer1\" style=\"white-space: nowrap;\"><a                    href=\"https://www.timvanx.com/\" style=\"color: #08c; text-decoration: none;\" rel=\"noopener\"                    target=\"_blank\">计协官网</a></span><br><span class=\"bottomContent\"><span class=\"footer1\"                                                                                         style=\"white-space: nowrap;\">Copyright © 2018</span><span>TimVan 范天明,<span                    class=\"nobr\"><a href=\"#address\" id=\"address\"                                    style=\"color: #888888; text-decoration: none;cursor:text;\">People's Republic of China (PRC).</a></span></span><span class=\"footer1\" style=\"white-space: nowrap;\">保留所有权利。</span></span></td></tr><tr class=\"footerBottomPadding\" style=\"height: 50px; -premailer-height: 50;\" height=\"50\"><td style=\"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-smooth: always; -webkit-font-smoothing: antialiased;\"></td></tr></tbody></table><table></table></div><script>    alert(\""+ctx+"\");    window.location.href='"+href+"';</script></body></html>");

        out.print(sb.toString());
    }

}
